package io.polly.ldz.webflux.converter;


import io.polly.ldz.webflux.entity.Question;
import io.r2dbc.spi.Row;
import org.springframework.core.convert.converter.Converter;
import org.springframework.data.convert.ReadingConverter;

/**
 * @author ldz112@163.com
 * @description：
 * @date 2025/3/13 10:28
 * Copyright (C) 2023 All Rights Reserved
 */
@ReadingConverter
public class QuestionConverter implements Converter<Row, Question> {
    @Override
    public Question convert(Row source) {

        if (source == null) return null;
        if (!source.getMetadata().contains("name")) return  null;
        Question question = new Question();
        return question;
    }
}
